/**
 * Hackystat Version 8 Framework
 * Sensor Data Viewer Widget
 */
package org.hackystat.ui.sensordatabrowser.client.common;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Asynchronous remote procedure call interface for getting sensor data from a RESTlet Sensorbase
 * server. Returns a formatted description of the sensor data over the requested interval.
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteServiceAsync {

  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * 
   * @param host the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param timestampString XML-format time stamp for start of data interval
   * @param callback address of return function
   */
  public void getDaySummary(String host, String project, String user, String password, 
      String timestampString, AsyncCallback callback);

  /**
   * Returns the index of all Projects from this server for this user..
   * @param uri the URI for the SensorBase.
   * @param user username (email address) for authentication.
   * @param password user password for authentication.
   * @param callback address of return function.
   */
  public void getProjectParcels(String uri, String user, String password, AsyncCallback callback);
     
  /**
   * Return a formatted description of the requested sensor data within the specified event.
   * @param uri the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param event to get items within.
   * @param reqPage the requested page.
   * @param callback the re-entry method
   */
  public void getEventItems(String uri, String project, String user, String password, 
    Event event, EventItemsPage reqPage, AsyncCallback callback);
  
  /**
   * Returns the host uri from the properties file.
   * 
   * @param callback the re-entry method
   */
  public void getHost(AsyncCallback callback);
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param uri the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param year of interval
   * @param month of interval
   * @param callback address of return function
   */
  public void getOverview(String uri, String project, 
    String user, String password, int year, int month, AsyncCallback callback);

  /**
   * Returns true if the passed host is a SensorBase host.
   * 
   * @param host the URI for the SensorBase
   * @param callback the re-entry method
   */
  public void isHost(String host, AsyncCallback callback);

  /**
   * Returns true if the user and password is registered as a user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param password key for authentication
   * @param callback the re-entry method
   */
  public void isRegistered(String host, String user, String password, AsyncCallback callback);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param callback the re-entry method
   */
  public void registerUser(String host, String user, AsyncCallback callback);
  
  /**
   * Returns the version number from the Manifest file.
   * 
   * @param callback the re-entry method
   */
  public void version(AsyncCallback callback);
}